home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / WordUp.dxr / Internal_3_question box.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  3.4 KB  |  96 lines

  1. property pSprite, spriteNum, pSelectColor, pNormColor
  2. global lastpicked, lastmem, wholelist, wholelist2, lasttile, gsel, currentscope
  3.  
  4. on beginSprite me
  5.   pSprite = sprite(spriteNum)
  6.   pSelectColor = rgb(74, 149, 149)
  7.   pNormColor = rgb(0, 0, 0)
  8.   pSprite.member.scrollTop = pSprite.member.linePosToLocV(0)
  9.   repeat with i = 1 to pSprite.member.paragraph.count
  10.     pSprite.member.paragraph[i].color = pNormColor
  11.   end repeat
  12. end
  13.  
  14. on mouseDown me
  15.   pointClicked = the mouseLoc
  16.   if pSprite.pointToLine(pointClicked) <> -1 then
  17.     if pSprite.member.line[pSprite.pointToLine(pointClicked)] <> EMPTY then
  18.       member("question in focus").text = pSprite.member.line[pSprite.pointToLine(pointClicked)]
  19.       pSprite.member.line[pSprite.pointToLine(pointClicked)].color = pSelectColor
  20.       puppetSound(4, "select clue")
  21.       if pSprite.member.name contains "across" then
  22.         if not voidp(lasttile) then
  23.           if currentscope = #across then
  24.             repeat with i = 1 to lasttile.ptilelist.count
  25.               lasttile.ptilelist[i].member = lasttile.ptilelist[i].pnorm
  26.             end repeat
  27.           else
  28.             repeat with i = 1 to lasttile.ptilelist2.count
  29.               lasttile.ptilelist2[i].member = lasttile.ptilelist2[i].pnorm
  30.             end repeat
  31.           end if
  32.         end if
  33.         currentscope = #across
  34.         ogDelim = the itemDelimiter
  35.         the itemDelimiter = "."
  36.         ass = pSprite.member.line[pSprite.pointToLine(pointClicked)].item[1]
  37.         the itemDelimiter = ogDelim
  38.         gsel = wholelist[ass][1]
  39.         wholelist[ass][1].member = wholelist[ass][1].pdown
  40.         lasttile = gsel
  41.         repeat with i = 1 to wholelist[ass].count
  42.           if wholelist[ass][i] = gsel then
  43.             next repeat
  44.           end if
  45.           wholelist[ass][i].member = wholelist[ass][i].pselect
  46.         end repeat
  47.       else
  48.         if not voidp(lasttile) then
  49.           if currentscope = #across then
  50.             repeat with i = 1 to lasttile.ptilelist.count
  51.               lasttile.ptilelist[i].member = lasttile.ptilelist[i].pnorm
  52.             end repeat
  53.           else
  54.             repeat with i = 1 to lasttile.ptilelist2.count
  55.               lasttile.ptilelist2[i].member = lasttile.ptilelist2[i].pnorm
  56.             end repeat
  57.           end if
  58.         end if
  59.         currentscope = #down
  60.         ogDelim = the itemDelimiter
  61.         the itemDelimiter = "."
  62.         ass = pSprite.member.line[pSprite.pointToLine(pointClicked)].item[1]
  63.         the itemDelimiter = ogDelim
  64.         gsel = wholelist2[ass][1]
  65.         wholelist2[ass][1].member = wholelist2[ass][1].pdown
  66.         lasttile = gsel
  67.         repeat with i = 1 to wholelist2[ass].count
  68.           if wholelist2[ass][i] = gsel then
  69.             next repeat
  70.           end if
  71.           wholelist2[ass][i].member = wholelist2[ass][i].pselect
  72.         end repeat
  73.       end if
  74.       if not voidp(lastpicked) and not voidp(lastmem) then
  75.         if lastpicked <> pSprite.pointToLine(pointClicked) then
  76.           lastmem.line[lastpicked].color = pNormColor
  77.         end if
  78.       end if
  79.       lastmem = pSprite.member
  80.       lastpicked = pSprite.pointToLine(pointClicked)
  81.     end if
  82.   end if
  83. end
  84.  
  85. on fixshit me, myques
  86.   pSprite.member.line[myques].color = pSelectColor
  87.   pSprite.member.scrollTop = pSprite.member.linePosToLocV(myques) - 20
  88.   if not voidp(lastpicked) and not voidp(lastmem) then
  89.     if lastpicked <> myques then
  90.       lastmem.line[lastpicked].color = pNormColor
  91.     end if
  92.   end if
  93.   lastmem = pSprite.member
  94.   lastpicked = myques
  95. end
  96.